<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <title>易渔论坛</title>
    <link href="https://cdnjs.cloudflare.com/ajax/libs/tailwindcss/2.2.19/tailwind.min.css" rel="stylesheet">
    <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css" rel="stylesheet">
    <link href="css/style.css" rel="stylesheet">
    <link rel="icon" href="assets/logo/logo.png">
</head>

<body class="bg-gray-100 min-h-screen">
    <div id="particles-js" class="fixed inset-0 z-0"></div>

    <!-- 导航栏 -->
    <nav class="bg-gradient-to-r from-blue-700 to-blue-500 text-white shadow-lg relative z-10">
        <div class="container mx-auto px-4 py-3">
            <div class="flex flex-wrap justify-between items-center">
                <div class="flex items-center">
                    <img src="assets/logo/logo.png" alt="易渔" style="width: 30px;height: 40px;">
                    <a href="index.html" class="text-2xl font-bold">易渔</a>
                </div>
                <div class="hidden md:flex space-x-8 text-lg">
                    <a href="index.html" class="hover:text-blue-200 transition duration-300">首页</a>
                    <a href="forum.html"
                        class="hover:text-blue-200 transition duration-300 border-b-2 border-white">论坛</a>
                    <a href="mall.html" class="hover:text-blue-200 transition duration-300">商城</a>
                    <a href="#" class="hover:text-blue-200 transition duration-300" id="communityBtn">社区活动</a>
                    <a href="#" class="hover:text-blue-200 transition duration-300" id="techniqueBtn">钓技研究</a>
                </div>
                <div class="flex items-center">
                    <a href="cart.html" class="mr-4 relative">
                        <i class="fas fa-shopping-cart text-xl"></i>
                        <span id="cart-count"
                            class="absolute -top-2 -right-2 bg-red-500 text-white rounded-full h-5 w-5 flex items-center justify-center text-xs">0</span>
                    </a>
                    <div id="user-auth-section">
                        <a href="auth.html"
                            class="bg-white text-blue-600 hover:bg-blue-100 px-4 py-2 rounded-lg font-medium transition duration-300">登录/注册</a>
                    </div>
                    <div id="user-info-section" class="hidden">
                        <div class="flex items-center">
                            <img id="user-avatar" src="https://picsum.photos/40/40" alt="用户头像"
                                class="w-8 h-8 rounded-full mr-2">
                            <span id="username" class="font-medium"></span>
                            <button id="logout-btn" class="ml-3 text-sm text-blue-200 hover:text-white">退出</button>
                        </div>
                    </div>
                    <button id="mobile-menu-btn" class="md:hidden ml-4">
                        <i class="fas fa-bars text-2xl"></i>
                    </button>
                </div>
            </div>
            <!-- 移动端菜单 -->
            <div id="mobile-menu" class="hidden md:hidden w-full mt-3">
                <a href="index.html" class="block py-2 hover:bg-blue-600 px-2 rounded">首页</a>
                <a href="forum.html" class="block py-2 hover:bg-blue-600 px-2 rounded">论坛</a>
                <a href="mall.html" class="block py-2 hover:bg-blue-600 px-2 rounded">商城</a>
                <a href="#" class="block py-2 hover:bg-blue-600 px-2 rounded">社区活动</a>
                <a href="#" class="block py-2 hover:bg-blue-600 px-2 rounded">钓技研究</a>
            </div>
        </div>
    </nav>

    <!-- 帖子内容区域 -->
    <div class="container mx-auto px-4 py-8 relative z-10">
        <!-- 面包屑导航 -->
        <div class="mb-6">
            <nav class="flex" aria-label="Breadcrumb">
                <ol class="inline-flex items-center space-x-1 md:space-x-3">
                    <li class="inline-flex items-center">
                        <a href="index.html" class="text-gray-700 hover:text-blue-600">
                            <i class="fas fa-home mr-2"></i>首页
                        </a>
                    </li>
                    <li>
                        <div class="flex items-center">
                            <i class="fas fa-chevron-right text-gray-400 mx-2"></i>
                            <a href="forum.html" class="text-gray-700 hover:text-blue-600">论坛</a>
                        </div>
                    </li>
                    <li>
                        <div class="flex items-center">
                            <i class="fas fa-chevron-right text-gray-400 mx-2"></i>
                            <span id="post-section-breadcrumb" class="text-gray-700 hover:text-blue-600">板块</span>
                        </div>
                    </li>
                    <li aria-current="page">
                        <div class="flex items-center">
                            <i class="fas fa-chevron-right text-gray-400 mx-2"></i>
                            <span id="post-title-breadcrumb"
                                class="text-gray-500 truncate max-w-xs md:max-w-sm">帖子标题</span>
                        </div>
                    </li>
                </ol>
            </nav>
        </div>

        <!-- 帖子详情卡片 -->
        <div class="bg-white rounded-lg shadow-md overflow-hidden mb-8">
            <!-- 帖子头部 -->
            <div id="post-header" class="border-b border-gray-200 p-6">
                <h1 id="post-title" class="text-2xl font-bold mb-3">加载中...</h1>
                <div class="flex flex-wrap items-center text-sm text-gray-500 mb-4">
                    <span id="post-section" class="bg-blue-100 text-blue-800 px-2 py-1 rounded mr-3">板块</span>
                    <span id="post-date" class="mr-3"><i class="far fa-calendar mr-1"></i>日期</span>
                    <span id="post-views" class="mr-3"><i class="far fa-eye mr-1"></i>0 浏览</span>
                    <span id="post-comments-count" class="mr-3"><i class="far fa-comment mr-1"></i>0 评论</span>
                </div>
                <div class="flex items-center">
                    <img id="post-author-avatar" src="https://picsum.photos/40/40" alt="作者头像"
                        class="w-10 h-10 rounded-full mr-3">
                    <div>
                        <div id="post-author" class="font-medium">作者</div>
                        <div id="post-author-title" class="text-xs text-gray-500">钓鱼爱好者</div>
                    </div>
                </div>
            </div>

            <!-- 帖子内容 -->
            <div id="post-content" class="p-6 text-gray-800 leading-relaxed">
                <div class="flex justify-center items-center h-32">
                    <div class="animate-spin rounded-full h-10 w-10 border-t-2 border-b-2 border-blue-500"></div>
                </div>
            </div>

            <!-- 帖子互动区 -->
            <div class="border-t border-gray-200 px-6 py-4 bg-gray-50">
                <div class="flex flex-wrap justify-between">
                    <div class="flex space-x-4">
                        <button id="like-post-btn"
                            class="flex items-center text-gray-600 hover:text-blue-600 transition">
                            <i class="far fa-thumbs-up mr-1"></i>
                            <span id="post-likes-count">0</span>
                        </button>
                        <button class="flex items-center text-gray-600 hover:text-blue-600 transition"
                            onclick="document.getElementById('comment-form').scrollIntoView({behavior: 'smooth'})">
                            <i class="far fa-comment mr-1"></i>
                            <span>评论</span>
                        </button>
                        <button id="collect-post-btn"
                            class="flex items-center text-gray-600 hover:text-yellow-600 transition">
                            <i class="far fa-star mr-1"></i>
                            <span>收藏</span>
                        </button>
                    </div>
                    <div class="flex space-x-2">
                        <button id="share-post-btn" class="text-gray-600 hover:text-green-600 transition">
                            <i class="fas fa-share-alt mr-1"></i>
                            分享
                        </button>
                        <button id="report-post-btn" class="text-gray-600 hover:text-red-600 transition">
                            <i class="fas fa-flag mr-1"></i>
                            举报
                        </button>
                    </div>
                </div>
            </div>
        </div>

        <!-- 评论区 -->
        <div class="bg-white rounded-lg shadow-md overflow-hidden mb-8">
            <div class="border-b border-gray-200 px-6 py-4">
                <h2 class="text-xl font-bold flex items-center">
                    <i class="far fa-comments mr-2 text-blue-500"></i>
                    评论区
                    <span id="comment-count" class="ml-2 text-sm text-gray-500">(0)</span>
                </h2>
            </div>

            <!-- 评论列表 -->
            <div id="comments-list" class="divide-y divide-gray-200">
                <div class="p-6 text-center text-gray-500">
                    <i class="far fa-comment-dots text-4xl mb-2"></i>
                    <p>暂无评论，来发表第一条评论吧！</p>
                </div>
            </div>

            <!-- 评论表单 -->
            <div id="comment-form" class="border-t border-gray-200 bg-gray-50 p-6">
                <h3 class="text-lg font-bold mb-4">发表评论</h3>
                <div id="need-login-message"
                    class="hidden bg-yellow-50 border border-yellow-200 text-yellow-800 p-4 rounded-lg mb-4">
                    请先 <a href="auth.html" class="text-blue-600 font-medium">登录</a> 后再发表评论
                </div>
                <div id="comment-form-container">
                    <div class="mb-4">
                        <textarea id="comment-content" rows="4"
                            class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500"
                            placeholder="请输入评论内容..."></textarea>
                        <p id="comment-error" class="text-red-500 text-sm mt-1 hidden">评论内容不能为空</p>
                    </div>
                    <div class="flex justify-end">
                        <button id="submit-comment"
                            class="bg-blue-600 hover:bg-blue-700 text-white px-6 py-2 rounded-lg transition duration-300">
                            <i class="fas fa-paper-plane mr-2"></i>发表评论
                        </button>
                    </div>
                </div>
            </div>
        </div>

        <!-- 推荐帖子 -->
        <div class="mb-8">
            <h2 class="text-xl font-bold mb-4 text-gray-800">相关推荐</h2>
            <div class="grid grid-cols-1 md:grid-cols-3 gap-6" id="recommended-posts">
                <!-- 推荐帖子将由JavaScript动态生成 -->
            </div>
        </div>
    </div>

    <!-- 分享弹窗 -->
    <div id="share-modal" class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 hidden">
        <div class="bg-white rounded-lg p-6 max-w-md w-full">
            <div class="flex justify-between items-center mb-4">
                <h3 class="text-xl font-bold">分享帖子</h3>
                <button id="close-share-modal" class="text-gray-500 hover:text-gray-700">
                    <i class="fas fa-times"></i>
                </button>
            </div>
            <div class="mb-4">
                <p class="text-sm text-gray-600 mb-2">复制链接分享给好友</p>
                <div class="flex">
                    <input id="share-link" type="text"
                        class="flex-1 px-3 py-2 border border-gray-300 rounded-l-lg focus:outline-none focus:ring-2 focus:ring-blue-500"
                        readonly>
                    <button id="copy-link"
                        class="bg-blue-600 hover:bg-blue-700 text-white px-4 py-2 rounded-r-lg transition duration-300">
                        复制
                    </button>
                </div>
            </div>
            <div class="grid grid-cols-4 gap-4 mb-2">
                <button class="flex flex-col items-center justify-center p-3 hover:bg-gray-100 rounded transition">
                    <div
                        class="w-10 h-10 rounded-full bg-green-500 flex items-center justify-center text-white text-xl mb-1">
                        <i class="fab fa-weixin"></i>
                    </div>
                    <span class="text-xs">微信</span>
                </button>
                <button class="flex flex-col items-center justify-center p-3 hover:bg-gray-100 rounded transition">
                    <div
                        class="w-10 h-10 rounded-full bg-blue-500 flex items-center justify-center text-white text-xl mb-1">
                        <i class="fab fa-qq"></i>
                    </div>
                    <span class="text-xs">QQ</span>
                </button>
                <button class="flex flex-col items-center justify-center p-3 hover:bg-gray-100 rounded transition">
                    <div
                        class="w-10 h-10 rounded-full bg-red-500 flex items-center justify-center text-white text-xl mb-1">
                        <i class="fab fa-weibo"></i>
                    </div>
                    <span class="text-xs">微博</span>
                </button>
                <button class="flex flex-col items-center justify-center p-3 hover:bg-gray-100 rounded transition">
                    <div
                        class="w-10 h-10 rounded-full bg-gray-700 flex items-center justify-center text-white text-xl mb-1">
                        <i class="fas fa-qrcode"></i>
                    </div>
                    <span class="text-xs">二维码</span>
                </button>
            </div>
        </div>
    </div>

    <!-- 举报弹窗 -->
    <div id="report-modal" class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 hidden">
        <div class="bg-white rounded-lg p-6 max-w-md w-full">
            <div class="flex justify-between items-center mb-4">
                <h3 class="text-xl font-bold">举报帖子</h3>
                <button id="close-report-modal" class="text-gray-500 hover:text-gray-700">
                    <i class="fas fa-times"></i>
                </button>
            </div>
            <div class="mb-4">
                <p class="text-sm text-gray-600 mb-4">请选择举报原因：</p>
                <div class="space-y-2">
                    <label class="flex items-center">
                        <input type="radio" name="report-reason" value="spam" class="mr-2">
                        <span>垃圾广告</span>
                    </label>
                    <label class="flex items-center">
                        <input type="radio" name="report-reason" value="inappropriate" class="mr-2">
                        <span>内容不当</span>
                    </label>
                    <label class="flex items-center">
                        <input type="radio" name="report-reason" value="duplicate" class="mr-2">
                        <span>重复内容</span>
                    </label>
                    <label class="flex items-center">
                        <input type="radio" name="report-reason" value="other" class="mr-2">
                        <span>其他原因</span>
                    </label>
                </div>
            </div>
            <div id="other-reason-container" class="mb-4 hidden">
                <label for="other-reason" class="block text-sm text-gray-600 mb-2">请说明原因：</label>
                <textarea id="other-reason" rows="3"
                    class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500"
                    placeholder="请输入举报原因..."></textarea>
            </div>
            <div class="flex justify-end">
                <button id="cancel-report"
                    class="mr-3 bg-gray-300 hover:bg-gray-400 text-gray-800 px-4 py-2 rounded transition duration-300">
                    取消
                </button>
                <button id="submit-report"
                    class="bg-red-600 hover:bg-red-700 text-white px-4 py-2 rounded transition duration-300">
                    提交举报
                </button>
            </div>
        </div>
    </div>

    <!-- 功能开发中弹窗 -->
    <div id="development-modal"
        class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 hidden">
        <div class="bg-white rounded-lg p-8 max-w-md w-full">
            <div class="text-center">
                <i class="fas fa-code text-4xl text-blue-500 mb-4"></i>
                <h3 class="text-2xl font-bold mb-2">功能开发中</h3>
                <p class="text-gray-600 mb-6">该功能正在积极开发中，敬请期待！</p>
                <button id="close-dev-modal"
                    class="bg-blue-500 hover:bg-blue-600 text-white px-6 py-2 rounded transition duration-300">
                    了解
                </button>
            </div>
        </div>
    </div>

    <!-- 通知弹窗 -->
    <div id="notification"
        class="fixed bottom-4 right-4 bg-green-500 text-white p-4 rounded-lg shadow-lg transform translate-y-20 opacity-0 transition-all duration-300 z-50 hidden">
        操作成功
    </div>

    <!-- 页脚 -->
    <footer class="bg-gray-800 text-white py-8 mt-12 relative z-10">
        <div class="container mx-auto px-4">
            <div class="grid grid-cols-1 md:grid-cols-4 gap-8">
                <div>
                    <h4 class="text-lg font-bold mb-4">关于我们</h4>
                    <p class="text-gray-400">钓鱼天堂是一个致力于为钓鱼爱好者提供交流平台和专业装备的综合性网站。</p>
                </div>
                <div>
                    <h4 class="text-lg font-bold mb-4">快速链接</h4>
                    <ul class="space-y-2 text-gray-400">
                        <li><a href="index.html" class="hover:text-white transition">首页</a></li>
                        <li><a href="forum.html" class="hover:text-white transition">论坛</a></li>
                        <li><a href="mall.html" class="hover:text-white transition">商城</a></li>
                        <li><a href="auth.html" class="hover:text-white transition">注册/登录</a></li>
                    </ul>
                </div>
                <div>
                    <h4 class="text-lg font-bold mb-4">联系我们</h4>
                    <ul class="space-y-2 text-gray-400">
                        <li><i class="fas fa-envelope mr-2"></i> contact@fishingheaven.com</li>
                        <li><i class="fas fa-phone mr-2"></i> 400-123-4567</li>
                        <li><i class="fas fa-map-marker-alt mr-2"></i> 渔乐路88号钓鱼天堂大厦</li>
                    </ul>
                </div>
                <div>
                    <h4 class="text-lg font-bold mb-4">关注我们</h4>
                    <div class="flex space-x-4">
                        <a href="#" class="text-gray-400 hover:text-white text-xl transition"><i
                                class="fab fa-weixin"></i></a>
                        <a href="#" class="text-gray-400 hover:text-white text-xl transition"><i
                                class="fab fa-weibo"></i></a>
                        <a href="#" class="text-gray-400 hover:text-white text-xl transition"><i
                                class="fab fa-qq"></i></a>
                        <a href="#" class="text-gray-400 hover:text-white text-xl transition"><i
                                class="fab fa-tiktok"></i></a>
                    </div>
                </div>
            </div>
            <div class="border-t border-gray-700 mt-8 pt-6 text-center text-gray-400">
                <p>&copy; 2025 钓鱼天堂 版权所有 | 钓友们的网上家园</p>
            </div>
        </div>
    </footer>

    <!-- 粒子效果 -->
    <script src="https://cdnjs.cloudflare.com/ajax/libs/particles.js/2.0.0/particles.min.js"></script>
    <script src="js/app.js"></script>
    <script src="js/forum.js"></script> 
    <script type="module" src="./js/childJS/post.js"></script>
</body>

</html>